package com.project.demo.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.project.demo.entity.Admin;
import com.project.demo.entity.Product;
import com.project.demo.vo.MessageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.project.demo.vo.ProductVo;
import org.springframework.web.bind.annotation.RequestMapping;
import com.project.demo.service.ProductService;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Date;


@RestController
public class ProductController {
    @Autowired
    private ProductService productService;


    @RequestMapping("/product")
    public ProductVo product(Integer page, Integer limit) {
        return productService.FindProductVo(page, limit);
    }

    @RequestMapping("/product1")
    public ProductVo product1() {
        return productService.FindAllProductVo();
    }

    @RequestMapping("/product1/{id}")
    public Integer deleteVo(@PathVariable("id") Integer id) {
        return productService.deletevo(id);
    }

    @RequestMapping("/addproduct")
    public Integer insertproduct(Integer id, String zcid, String zcname, Integer money, String zcclass, String zcperson, String begint) {
        return productService.insertvo(id, zcid, zcname, money, zcclass, zcperson, begint);
    }

}